package com.fyzk.bean;

import android.support.annotation.NonNull;

import com.fyzk.model.JCLQMatchData;

import java.util.ArrayList;
import java.util.List;

public class JCLQResponseInfo implements Cloneable, Comparable {

    public JCLQResponseInfo() {

    }

    public int lotteryType; // "3001",
    public String matchWeekday = ""; // "周三",
    public String phaseNo = ""; // "20141126",
    public String matchTime = ""; // "2014-11-26",
    public List<JCLQMatchData> matchDatas = new ArrayList<JCLQMatchData>();

    @Override
    public int compareTo(@NonNull Object o) {
        JCLQResponseInfo a = (JCLQResponseInfo) o;
        if (a != null) {
            Long phaseNo = Long.parseLong(a.phaseNo);
            Long phaseThis = Long.parseLong(this.phaseNo);
            if (phaseNo > phaseThis) {
                return -1;
            } else if(phaseNo < phaseThis){
                return 1;
            }
        }
        return 0;
    }

    public JCLQResponseInfo copy() {
        JCLQResponseInfo info = new JCLQResponseInfo();
        info.lotteryType = this.lotteryType;
        info.matchWeekday = this.matchWeekday;
        info.phaseNo = this.phaseNo;
        info.matchTime = this.matchTime;
        info.matchDatas = new ArrayList<JCLQMatchData>();
        return info;
    }

    @Override
    public boolean equals(Object o) {
        // TODO Auto-generated method stub
        if (this.phaseNo.equals(((JCLQResponseInfo) o).phaseNo)) {
            return true;
        }
        return super.equals(o);
    }
}